import { defineStore } from 'pinia'

interface IFoo {
	dict: any
}

export const useDictStore = defineStore('dict', {
	state(): IFoo {
		return {
			dict: {}
		}
	},
	actions: {
		getDict(key: string) {
			if (key == null && key == '') {
				return undefined
			}
			for (const item of this.dict) {
				if (item.key == key) {
					return item.list
				}
			}
		},
		setDict(key: string, list: any[]) {
			console.log('==', key, list)
		}
	}
})
